<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:o="http://omnifaces.org/ui"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">


        <o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" />
        <p class="help-block">
            #{bundle['file.requestAccessTermsDialog.tip']}
        </p>
        
        <div class="form-horizontal">
            <div class="form-group" jsf:rendered="#{workingVersion.termsOfUseAndAccess.license != 'CC0' and !empty workingVersion.termsOfUseAndAccess.termsOfUse}">
                <label class="col-sm-3 control-label" for="guestbook_tou">
                    #{bundle['file.dataFilesTab.terms.list.termsOfUse.termsOfUse']}
                </label>
                <div class="col-sm-6">
                    <div class="panel panel-default">
                        <div class="panel-body read-terms">
                            <h:outputText value="#{MarkupChecker:sanitizeBasicHTML(workingVersion.termsOfUseAndAccess.termsOfUse)}" escape="false" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group" jsf:rendered="#{!empty workingVersion.termsOfUseAndAccess.termsOfAccess}">
                <label class="col-sm-3 control-label" for="guestbook_toa">
                    #{bundle['file.dataFilesTab.terms.list.termsOfAccess.termsOfsAccess']}
                </label>
                <div class="col-sm-6">
                    <div class="panel panel-default">
                        <div class="panel-body read-terms">
                            <h:outputText value="#{MarkupChecker:sanitizeBasicHTML(workingVersion.termsOfUseAndAccess.termsOfAccess)}" escape="false" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="button-block">
            <p:commandButton styleClass="btn btn-default" value="#{bundle.acceptTerms}" 
                           action="#{fileDownloadHelper.requestAccessIndirect()}"    
                           update="@([id$=requestAccessPopupButton])" oncomplete="PF('requestAccessPopup').hide();">
            </p:commandButton>
            <button class="btn btn-link" onclick="PF('requestAccessPopup').hide();PF('blockDatasetForm').hide();" type="button">
                #{bundle.cancel}
            </button>
        </div>
</ui:composition>
